<%@page import="java.util.Locale"%>
<%@page import="java.util.ResourceBundle"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.text.Format"%>
<% request.setCharacterEncoding("utf-8"); %>
<%
	response.setCharacterEncoding("utf-8");
	ResourceBundle resource = ResourceBundle.getBundle("language",
		new Locale("en"));
	Format formatter = new SimpleDateFormat("yyyy");
	Format formatter1 = new SimpleDateFormat("M");
	Format formatter2 = new SimpleDateFormat("d");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@page import="java.util.Date"%>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
		<title><%=resource.getString("title_archives") %></title>
		<meta name="description" content="<%=resource.getString("description_archives") %>"/>
		<meta name="Keywords" content="<%=resource.getString("keyword_archives") %>"/>	
		<meta http-equiv="content-language" content="<%=resource.getString("language")%>">
		<meta content="text/html; charset=utf-8" http-equiv="content-type" />
		<link rel='stylesheet' type='text/css' href='/css/articles_date.css' />
		<link rel="alternate" type="application/rss+xml" title="article - RSS" href="/rss" />
	</head>
	<body>
		<div class="link_index"><a href="/"><%=resource.getString("go_home") %></a></div>
		<div class="headder"></div>
		<div class="content">
			<ul class="list">
				<%
					Date date = new Date();
					int end;
					int start=1;
					int end_day;
					int start_end_day=1;
					String month = "";
					int start_day = Integer.parseInt(resource.getString("start_day"));
					int start_month = Integer.parseInt(resource.getString("start_month"));
					int start_year = Integer.parseInt(resource.getString("start_year"));
					
					for(int i=Integer.parseInt(formatter.format(date));i>=start_year;i--)
					{
						if(i == Integer.parseInt(formatter.format(date)))
						{
							end = Integer.parseInt(formatter1.format(date));
						} else {
							end = 12;
						}
						if(i==start_year)
							start = start_month;
						for(int j=end;j>=start;j--)
						{
							if(j == Integer.parseInt(formatter1.format(date)))
							{
								end_day = Integer.parseInt(formatter2.format(date));
							} else {
								end_day = 30;
							}
							if(i==start_year&&j==start_month)
									start_end_day = start_day;
							for(int k=end_day;k>=start_end_day;k--)
							{
								String mm = (j<10)?"0"+j:j+"";
								String dd = (k<10)?"0"+k:k+"";
								out.print("<li><a href='/archives/"+mm+"-"+dd+"-"+i+"'>"+j+"-"+k+"-"+i+"</a></li>");
							}
						}
					}
				%>
			</ul>
			<div class="clear"></div>
		</div>
	</body>
</html>		